pkg_name=dbus
version=1.8.16
build_dir=$builds_dir_root/$pkg_name-$version
src_dir=$src_dir_root/$pkg_name-$version
url=http://dbus.freedesktop.org/releases/dbus/dbus-1.8.16.tar.gz

cd "$src_dir_root"
rm -Rf "$pkg_name-$version"
tar zxf "$pkg_name-$version.tar.gz"

rm -Rf "$build_dir"
mkdir -p "$build_dir"
cd "$build_dir"

#SECURITY WARNING: dbus-daemon-launch-helper is SUID ROOT
#we remove it
#/libexec/dbus-daemon-launch-helper:4750:0:0 to 750

export CFLAGS=-O0
"$src_dir/configure"				\
	--prefix=/				\
	--disable-static			\
	--disable-compiler-coverage		\
	--disable-compiler-optimisations	\
	--disable-developer			\
	--disable-verbose-mode			\
	--disable-asserts			\
	--disable-checks			\
	--disable-xml-docs			\
	--disable-doxygen-docs			\
	--enable-abstract-sockets		\
	--disable-selinux			\
	--disable-libaudit			\
	--enable-inotify			\
	--disable-kqueue			\
	--disable-console-owner-file		\
	--disable-launchd			\
	--disable-systemd			\
	--disable-embedded-tests		\
	--disable-modular-tests			\
	--disable-tests				\
	--disable-installed-tests		\
	--enable-epoll				\
	--disable-x11-autolaunch		\
	--disable-stats				\
	--with-x				\
	--with-gnu-ld
	
unset CFLAGS

make

install_tmp_dir=/tmp/$pkg_name-$version
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/runtime.links"
install_dirs "$builders_dir_root/$pkg_name/devel.dirs"
install_files "$builders_dir_root/$pkg_name/devel.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/devel.links"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

#rm -Rf "$install_tmp_dir"
rm -Rf "$build_dir"
rm -Rf "$src_dir"
